home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / proxy11.zip / CROSS.PRX < prev    next >
Text File  |  1991-10-28  |  557b  |  21 lines

  1. // xu: map(string,set(string))
  2.  
  3. add_mod(m,ms) {xu[m]=ms;};
  4.  
  5. uses(m) {return xu[m];};
  6.  
  7. used_by(m) {return {ms:ms<-dom xu;m in xu[ms]};};
  8.  
  9. rec_mod() {return {m:m<-dom xu;reaches(m,m)};};
  10.  
  11. reaches(m1,m2) {return ((m2 in xu[m1]) || (exists m in xu[m1];
  12.                        reaches(m,m2)));};
  13. add_mod("top",{"mid1","mid2"});
  14. add_mod("mid1",{"bot1","bot2","mid1"}); // a recursive reference, e.g.
  15.                     // "mid1" must not be the "first"
  16.                     // item in the second argument
  17. add_mod("mid2",{"bot2"});
  18. add_mod("bot1",{"top","mid1"});
  19. add_mod("bot2",{});
  20. end
  21.